<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			let website="https://image.baidu.com/search/index?tn=baiduimage&ps=1&ct=201326592&lm=-1&cl=2&nc=1&ie=utf-8&dyTabStr=MCwxMiwzLDEsMiwxMyw3LDYsNSw5&word=JS%E5%8F%98%E9%87%8F%E8%A1%A8%E8%BE%BE%E5%BC%8F"
			let index=website.indexOf('?')
			let temp=website.substr(index+1)//index表示“？”位置
			console.log(temp);
			let array=temp.split("&")
			console.log(array);
			let obj={}
			for (var i = 0; i < array.length; i++) {
				let args=array[i].split("=")   //array[i]   tn=baiduimage
				let name=args[0]  //tn
				let value=args[1] // tn=baiduimage
				obj[name]=decodeURI(value) //对ASCII编码进行解码，并写入对象中
			}
			console.log(obj);
		</script>
	</head>
	<body>
		
	</body>
</html>
